<%@ page language="java" import="java.util.*" pageEncoding="GB18030"
	import="Reservation.UserBean, DomainData.Reservation, Application.Dao.ReservationDAO"%>

<div id="submenu_reservation">
			<h2 class="subhead">Reservation</h2>
			<ul class="menu">
				<li><a href="#" onclick="RESERVATION.showPage();">New Reservation</a></li>
				<li><a href="#" onclick="RESERVATION.showPage(RESERVATION.LIST);">Change Reservation</a></li>
			</ul>
			<div class ="clear"></div>
</div>
		
		
<div id="dialog_reservation">
				<img src="images/TableReservations.jpg"  width="100%" height="200" />
					<form id="reservation_imf">
						<label> Enter the Basic Information: </label>
					<table>
						<tr>
								<td align="left">Number of People</td>
								<td align="right"><input type="text" id="people_num" class="formname"
									name="people_num" />
								</td>
							</tr>
							<tr>
								<td align="left">Date</td>
								<td align="right"><input type="text" id="datepicker" class="formname"
									name="datepicker" />
								</td>
							</tr>
							<tr>
								<!-- <td>Start Time<input type="text" id="time_start"/></td> -->
								<td align="left">From</td>
								<td align="right"><select name="From" id="from_time" class="formname">
										<option value="10:00:00">10:00</option>
										<option value="11:00:00">11:00</option>
										<option value="12:00:00">12:00</option>
										<option value="13:00:00">13:00</option>
										<option value="14:00:00">14:00</option>
										<option value="15:00:00">15:00</option>
										<option value="16:00:00">16:00</option>
										<option value="17:00:00">17:00</option>
										<option value="18:00:00">18:00</option>
										<option value="19:00:00">19:00</option>
										<option value="20:00:00">20:00</option>
										<option value="21:00:00">21:00</option>
										<option value="22:00:00">22:00</option>
								</select> To <select name="To" id="to_time" class="formname" onblur="testStartEndTime();">
										<option value="10:00:00">10:00</option>
										<option value="11:00:00">11:00</option>
										<option value="12:00:00">12:00</option>
										<option value="13:00:00">13:00</option>
										<option value="14:00:00">14:00</option>
										<option value="15:00:00">15:00</option>
										<option value="16:00:00">16:00</option>
										<option value="17:00:00">17:00</option>
										<option value="18:00:00">18:00</option>
										<option value="19:00:00">19:00</option>
										<option value="20:00:00">20:00</option>
										<option value="21:00:00">21:00</option>
										<option value="22:00:00">22:00</option>
								</select>
								</td>
							</tr>
							<tr><td align="left"> <input type="submit" class="sendform" value="submit"/></td></tr><br>
							
						</table>
					</form>
</div>
			
<div id="reservationList">
		<form id="cannelReservation">
		<table id ="reservationlist_var" width= "1000" position = "relative">
		<tr bgcolor="#F2F2F2">
			<td width="100">Reservation ID</td>
			<td width="250">From</td>
			<td width="250">To</td>
			<td width="60">Number Of People</td>
			<td width="60">Table ID</td>
			<td width="60">Edit</td>
			<td width="60">Delete</td>
		</tr>
		<%
			System.out.println("called here");
			int userID = currentUser.getUserID();
			List<Reservation> rlist = ReservationDAO.getReservations(userID);

			for (int i = 0; i < rlist.size(); i++) {
				Reservation r = rlist.get(i);
				int rID = r.getReservationID();
				out.println("<tr id='reservationlistContent"+r.getReservationID()+"'><td class='reservation_id'>"
						+ r.getReservationID()
						+ "</td><td>"
						+ r.getFrom().toString()
						+ "</td><td>"
						+ r.getTo().toString()
						+ "</td><td>"
						+ r.getNumberOfPeople()
						+ "</td><td>"
						+ r.getTableID()
						+"<td align='left'><a href='#' onclick='RESERVATION.openModifyDialog("+rID+");'>Edit</a></td>"
						+"<td align='left'><a href='#' onclick='RESERVATION.cannelReservation("+r.getReservationID()+");'>Remove</a></td></tr>");
			}
		%>
		</table>
		</form>
</div>


		<div id="modify_dialog">
				<label> Modify Your Reservation Information </label>"/Users/taojiegao/Desktop"
				<form >
				<table>
					
						<tr>
								<td align="left">Date</td>
								<td align="right"><input type="text" id="datepicker2"
									name="datepicker2" />
								</td>
						</tr>
						<tr>
								<td align="left">Number of People</td>
								<td align="right"><input type="text" id="new_people_num"
									name="people_num" />
								</td>
							</tr>
						<tr>
								<!-- <td>Start Time<input type="text" id="time_start"/></td> -->
								<td align="left">From</td>
								<td align="right"><select name="From" id="new_from_time">
										<option value="10:00:00">10:00</option>
										<option value="11:00:00">11:00</option>
										<option value="12:00:00">12:00</option>
										<option value="13:00:00">13:00</option>
										<option value="14:00:00">14:00</option>
										<option value="15:00:00">15:00</option>
										<option value="16:00:00">16:00</option>
										<option value="17:00:00">17:00</option>
										<option value="18:00:00">18:00</option>
										<option value="19:00:00">19:00</option>
										<option value="20:00:00">20:00</option>
										<option value="21:00:00">21:00</option>
										<option value="22:00:00">22:00</option>
								</select> To <select name="To" id="new_to_time" onblur="testModifyStartEndTime();">
										<option value="10:00:00">10:00</option>
										<option value="11:00:00">11:00</option>
										<option value="12:00:00">12:00</option>
										<option value="13:00:00">13:00</option>
										<option value="14:00:00">14:00</option>
										<option value="15:00:00">15:00</option>
										<option value="16:00:00">16:00</option>
										<option value="17:00:00">17:00</option>
										<option value="18:00:00">18:00</option>
										<option value="19:00:00">19:00</option>
										<option value="20:00:00">20:00</option>
										<option value="21:00:00">21:00</option>
										<option value="22:00:00">22:00</option>
								</select>
								</td>
							</tr><br>
							<tr>
								<td align="left"> <input type="submit" value="submit"/></td><br>
							</tr>
							
					
				</table>
				</form>
		</div>	